#include"Tree.h"


int main()
{
	BiTree T;
	cout << "根据伪先序序列创建二叉树："<<endl;
	Create(T);
	cout << endl;
	cout << "（递归）先序遍历序列："<<endl;
	PreOrderTraverse(T);
	cout << endl;
	cout << "（非递归）先序遍历序列：" << endl;
	iter_PreOrderTraverse(T);
	cout << endl;
	cout << "（递归）中序遍历序列：" << endl;
	InOrderTraverse(T);
	cout << endl;
	cout << "（非递归）中序遍历序列：" << endl;
	iter_InOrderTraverse(T);
	cout << endl;
	cout << "（递归）后序遍历序列：" << endl;
	PostOrderTraverse(T);
	cout << endl;
	cout << "层次遍历序列：" << endl;
	LevelOrderTraverse(T);
	cout << endl;
	/*这里最后最好再层次遍历（先中后序遍历会需要回溯，而回溯时因节点已销毁，则会出现野指针情况）一遍二叉树销毁其所有堆区开辟的节点，以免内存泄露*/
	//不再演示代码写法
	return 0;
}